
Const COUNT_NORMAL:Int = 0;
Const COUNT_RECURSIVE:Int = 1;

Rem
	Counts all elements in a string array, or properties in an string.
	Like the real php function, null values are ignored in the count
	
	@todo		Finish this function with recursive ability
	@note		There was no way to call to all types
	@author	Nicholas Grant
	@updatedby	
	@return	int
EndRem
Function count:Int( variable:String[], mode:Int = 0 )
	Local rturn:Int = 0;
	If ( Not mode )
		For Local cnt:Int=0 To variable.Length-1
			If ( variable[cnt] <> Null )
				rturn :+ 1;
			End If
		Next
	Else
		
	End If
	Return rturn;
End Function

Function count_int:Int( variable:Int[], mode:Int = 0 )
	Local rturn:Int = 0;
	If ( Not mode )
		For Local cnt:Int=0 To variable.Length-1
			If ( variable[cnt] <> Null )
				rturn :+ 1;
			End If
		Next
	Else
		
	End If
	Return rturn;
End Function

Function count_float:Int( variable:Float[], mode:Int = 0 )
	Local rturn:Int = 0;
	If ( Not mode )
		For Local cnt:Int=0 To variable.Length-1
			If ( variable[cnt] <> Null )
				rturn :+ 1;
			End If
		Next
	Else
		
	End If
	Return rturn;
End Function

Function count_str:Int ( variable:String[], mode:Int = 0 )
	Return count( variable, mode );
End Function
